﻿<Window x:Class="WpfImage.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="800" Width="1000">
    <Grid>
        <StackPanel  Orientation="Horizontal" Margin="5" VerticalAlignment="Top">
            <Image Source="r.png"  x:Name="imgTest" Width="200" Height="200" Stretch="None"/>
            <Image Source="r.png"  Width="200" Height="200" Margin="10" Stretch="Fill"/>
            <Image Source="r.png"  Width="200" Height="200" Margin="10" Stretch="Uniform"/>
            <Image Source="r.png"  Width="200" Height="200" Margin="10" Stretch="UniformToFill"/>
        </StackPanel>
        <StackPanel  Orientation="Horizontal" Margin="5" VerticalAlignment="Top">
            <StackPanel.Resources>
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="TextAlignment" Value="Center" />
                    <Setter Property="Foreground" Value="Red" />
                    <Setter Property="FontSize" Value="16" />
                    <Setter Property="Margin" Value="10" />
                </Style>
            </StackPanel.Resources>
            <TextBlock  Width="200" Height="200"  Text="Stretch:None"  />
            <TextBlock  Width="200" Height="200"  Text="Stretch:Fill"  />
            <TextBlock  Width="200" Height="200"  Text="Stretch:Uniform"  />
            <TextBlock  Width="200" Height="200"  Text="Stretch:UniformToFill"  />
        </StackPanel>
        <StackPanel  Orientation="Horizontal" Margin="5" VerticalAlignment="Center">
            <Image x:Name="img1"   Width="200" Height="200"  />
            <Image x:Name="img2"   Width="200" Height="200" Margin="10" />
            <Image  x:Name="img3"    Width="200" Height="200" Margin="10"  />
            <Image  x:Name="img4"   Width="200" Height="200" Margin="10" />
        </StackPanel>
    </Grid>
</Window>
